{% set monasca_log_dir = '/var/log/kolla/monasca' %}
{% set wsgi_path = '/monasca-api/monasca_api/api' %}

Listen {{ api_interface_address | put_address_in_context('url') }}:{{ monasca_api_port }}

TraceEnable off
TimeOut {{ kolla_httpd_timeout }}
KeepAliveTimeout {{ kolla_httpd_keep_alive }}

ErrorLog "{{ monasca_log_dir }}/apache-api-error.log"
<IfModule log_config_module>
    CustomLog "{{ monasca_log_dir }}/apache-api-access.log" common
</IfModule>

{% if monasca_logging_debug | bool %}
LogLevel info
{% endif %}

<VirtualHost *:{{ monasca_api_port }}>

    ErrorLog "{{ monasca_log_dir }}/monasca-api-error.log"
    LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat
    CustomLog "{{ monasca_log_dir }}/monasca-api-access.log" logformat
    WSGIApplicationGroup %{GLOBAL}
    WSGIDaemonProcess monasca-api group=monasca processes={{ monasca_api_workers }} threads=1 user=monasca
    WSGIProcessGroup  monasca-api
    WSGIScriptAlias / {{ wsgi_path }}/wsgi.py
    WSGIPassAuthorization On
    SetEnv no-gzip 1

    <Directory "{{ wsgi_path }}">
        Require all granted
    </Directory>

</VirtualHost>
